              package com.java.diagnostics.visualizer.impl.axes;
              
              import com.java.diagnostics.visualizer.data.axes.UnitConverterDefinition;
              
              public class UnitConverterDefinitionImpl
                implements UnitConverterDefinition
              {
                private static final String CLOSE_PARENTHESIS = ")";
                private static final String OPEN_PARENTHESIS = " (";
                private final String baseUnitName;
                private final String units;
                private final String label;
                private boolean supportsNormalisation;
              
                public UnitConverterDefinitionImpl(String baseUnitName, String label, String units, boolean supportsNormalisation)
                {
                  this.baseUnitName = baseUnitName;
                  this.units = units;
                  this.label = label;
                  this.supportsNormalisation = supportsNormalisation;
                }
              
                public String getBaseUnitName()
                {
                  return this.baseUnitName;
                }
              
                public String getLabel()
                {
                  return this.label;
                }
              
                public String getUnitName()
                {
                  return this.units;
                }
              
                public boolean supportsNormalisation()
                {
                  return this.supportsNormalisation;
                }
              
                public String toString()
                {
                  return this.label + " (" + this.units + ")";
                }
              
                public boolean equals(Object object)
                {
                  boolean equal = true;
              
                  if (this == object) {
                    equal = true;
                  }
                  else if (!(object instanceof UnitConverterDefinitionImpl)) {
                    equal = false;
                  }
                  else
                  {
                    UnitConverterDefinitionImpl definition = (UnitConverterDefinitionImpl)object;
                    if ((this.baseUnitName != null) && (!this.baseUnitName.equals(definition.getBaseUnitName()))) {
                      equal = false;
                    }
                    else if ((this.units != null) && (!this.units.equals(definition.getUnitName()))) {
                      equal = false;
                    }
                    else if ((this.label != null) && (!this.label.equals(definition.getLabel()))) {
                      equal = false;
                    }
                    else if (this.supportsNormalisation != definition.supportsNormalisation()) {
                      equal = false;
                    }
                  }
              
                  return equal;
                }
              
                public int hashCode()
                {
                  return toString().hashCode();
                }
              }

